@import "./mixin.scss";

/* 卡片 */
.side-card {
  padding: 0.2rem;
  border-radius: 0.2rem;
  box-shadow: 0 0 0.1rem 0.05rem var(--box-shadow);
  backdrop-filter: blur(0.25rem) saturate(150%);
  transition: all 0.3s ease-in-out 0s;
  background: var(--main-2);
  color: var(--main-1) !important;

  &:hover {
    box-shadow: 0 0 0.1rem 0.05rem var(--box-shadow-c);
  }

  &.glass {
    background: var(--main-2-ha2);
  }
}

/* 详情页布局 */
.page-header {
  position: relative;
  width: 100%;
  height: 70vh;
  box-shadow: 0 0.02rem 0.4rem 0.2rem var(--box-shadow);

  &::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--box-shadow);
    transition: all .2s ease-in-out 0s;
  }

  .page-title {
    position: absolute;
    top: 0;
    width: 100%;
    height: 40%;
    padding-top: 1.2rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--main-1-h8);
    z-index: 2;
  }

  .page-meta {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1.8rem;
    z-index: 2;
    color: var(--main-1);
    margin-bottom: 15vh;

    ::-webkit-scrollbar {
      display: none;
    }

    .item {
      position: relative;
      font-size: 0.4rem;
      line-height: 0.8rem;
      overflow: hidden;
      width: calc(100% - 0.2rem);
      height: calc(100% - 0.2rem);
      margin: 0.1rem auto;
      padding: 0 0.2rem;

      .meta-svg {
        position: absolute;
        top: 0;
        left: 0;
        width: 0.8rem;
        height: 0.6rem;
        background: var(--main-2);
        color: var(--main-1);
        border-radius: 0 0 0.2rem 0;
        padding: 0.1rem;
      }

      .meta-title {
        width: 100%;
        height: 0.8rem;
        margin: -0.1rem 0.8rem;
        color: var(--main-1-h10);
        overflow-x: scroll;
      }

      .meta-text {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        text-align: center;
        margin: 0 auto;
        width: 96%;
        font-weight: bold;
        color: var(--text-color);
      }
    }
  }

  .page-cover {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }
}

.main-container {
  display: flex;
  align-items: start;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  animation: slideUpIn 1s;

  .cate-icon {
    position: absolute;
    right: 0;
    width: 0.8rem;
    height: 0.8rem;
    padding: 0.2rem;
    z-index: 2;
  }

  .left-container {
    width: 100%;
    padding: 0.2rem;
    transition: all 0.3s;

    .cate-icon {
      border-radius: 0 0 0 0.1rem;
      top: 0;
    }
  }

  .right-container {
    position: sticky;
    width: 20%;
    min-width: 4.6rem;
    max-width: 8rem;
    top: -0.1rem;
    padding: 0.2rem 0.1rem 0 0;

    .side-card {
      position: relative;
      height: 20%;
      min-height: 4.8rem;
      max-height: 48vh;
      padding: 0.3rem 0.2rem 0.8rem;
      overflow: auto;
      overflow-x: hidden;
      background: var(--main-2-ha3);

      &:nth-child(1) {
        z-index: 1;
      }

      &:nth-child(2) {
        height: 1.2rem !important;
        min-height: 1.2rem !important;
        max-height: 1.2rem !important;
        margin: 0 auto;
        transform: translateY(-0.4rem);
        padding: 0.4rem 0.2rem 0;
        border-radius: 0 0 0.2rem 0.2rem;
        overflow: hidden;
        z-index: -1;
      }

      &:nth-child(3) {
        position: relative;
        min-height: 4.8rem !important;
        height: 4.8rem !important;
        padding: 0.2rem;
        overflow: hidden;

        .title {
          text-align: center;
          width: 100%;
          background: var(--main-2);
          border-radius: 0.1rem;
        }

        .user-box {
          display: flex;
          font-size: 0.4rem;
          align-items: center;
          justify-content: left;
          gap: 0.2rem;
          color: var(--main-1);
          margin-top: 0.2rem;
        }

        .user-intro {
          margin-top: 0.2rem;
          width: calc(100% + 0.15rem);
          height: 2rem;
          overflow-y: auto;
        }
      }

      .cate-icon {
        border-radius: 0.1rem 0 0 0;
        bottom: 0;
      }

      .share-info {
        position: absolute;
        bottom: 0.05rem;
      }

      .but-box {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        margin-top: 0.15rem;
      }
    }
  }
}

@media (max-width: 40rem) {
  .page-title {
    margin-top: 0.5rem;
    font-size: 0.8rem !important;
  }
}

/* 文本  */
.title {
  color: var(--main-1);
  font-weight: bold;
  font-size: 0.4rem;
}

.text {
  color: var(--text-color);
  font-weight: normal;
  font-size: 0.3rem;

  &::before {
    content: "";
    width: 0.6rem;
    display: inline-block;
  }
}

.time,
.like,
.comment {
  font-size: 0.25rem;
  color: var(--main-1-hs1);
}

.operation-text {
  display: inline-block;
  cursor: pointer;
  padding: 0.02rem 0.1rem;
  border-radius: 3px;
  color: var(--color-blue);
  transition: all .5s ease-in;

  &:hover {
    background-color: var(--main-1-h6);
  }
}


/* 居中 */
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 边距 */
.mt-4 {
  margin-top: 0.1rem;
}

.mt-12 {
  margin-top: 0.3rem;
}

.mt-10 {
  margin-top: 0.6rem;
}

.mt-11 {
  margin-top: 1rem;
}

/* 分页 */
.n-pagination-item:hover,
.n-pagination-item--active {
  color: var(--grey-0) !important;
  background-image: linear-gradient(to right, var(--main-1) 0, var(--main-2) 100%) !important;
  box-shadow: 0 0 .75rem var(--box-shadow) !important;
  border: none !important;
}

.pagination {
  justify-content: center;
  padding: 1.25rem 3.125rem;
}

.n-pagination .n-pagination-item {
  color: var(--main-1-h1);
}


/* 对话框 */
.dialog-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -100;
  width: 8rem;
  height: 9rem;
  padding: 1.6rem 1.1rem 0;

  .input {
    font-size: 0.2rem;
    line-height: 0.4rem;
    transition: 0.4s;
    height: 0.6rem;

    &:hover {
      box-shadow: 0 0 0.25rem 0.12rem var(--main-1);
    }
  }

  .comm-submit {
    margin-left: 1.5rem;
  }
}

.colorFlag {
  cursor: url(../cursor/help.cur), default !important;
  color: var(--main-1);

  &:hover {
    color: var(--main-1-h10);
  }
}

/* 按钮 */
.comm-submit {
  position: relative;
  width: 2.8rem;
  height: 0.8rem;
  border: none;
  background: transparent;
  padding: 0;
  transition: filter 250ms;
  user-select: none;
  touch-action: manipulation;

  .edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.25rem;
    background: linear-gradient(to left, var(--main-2-h2) 0%, var(--main-2-h4) 8%,
            var(--main-2-h4) 92%, var(--main-2-h2) 100%);
  }

  .front {
    width: 2.8rem;
    height: 0.8rem;
    border-radius: 0.25rem;
    font-weight: bold;
    color: var(--main-1-hs3);
    background: var(--main-2);
    will-change: transform;
    transform: translateY(-0.1rem);
    transition: transform 600ms cubic-bezier(.3, .7, .4, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.5rem;
  }

  &:hover {
    filter: brightness(120%);

    .front {
      transform: translateY(-0.2rem);
      transition: transform 250ms cubic-bezier(.3, .7, .4, 1.5);
    }
  }

  &:active .front {
    transform: none;
    transition: transform 34ms;
  }

  &:focus:not(:focus-visible) {
    outline: none;
  }
}

.but {
  width: 1.6rem;
  height: 0.6rem;
  background: var(--main-2);
  color: var(--main-1);
  font-weight: bold;
  font-size: 0.4rem;
  border-radius: 0.1rem;
  box-shadow: 0 0 0.04rem 0.02rem var(--box-shadow);
  text-align: center;
  overflow: hidden;

  &:hover {
    filter: brightness(130%);
  }
}

/* 加载进度条 */
#nprogress .bar {
  background: var(--primary-color) !important;
}

/** 用户信息 */
.author-avatar {
  width: 0.8rem;
  height: 0.8rem;
  box-shadow: 0 0 0.06rem 0.03rem var(--box-shadow-c);
  border-radius: 50%;

  &:hover {
    -webkit-animation: author-shake 1s;
    animation: 1000ms ease 0ms 1 normal none running author-shake;
  }
}

.user-avatar {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  box-shadow: 0 0 0.1rem 0.05rem var(--box-shadow);
}

.user-avatar-square {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.1rem;
  box-shadow: 0 0 0.08rem 0.04rem rgba(0, 0, 0, .2);
}

/* 题目 */
.quiz-user-name {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  margin-right: 0.3125rem;
  color: #ef89c6;
}

.quiz-content {
  margin-top: 0.3125rem;
  font-size: 0.9375rem;
  line-height: 1.5rem;
  word-wrap: break-word;
  word-break: break-all;
  white-space: pre-line;
}

.quiz-image {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
  margin-top: 0.3125rem;

  .image {
    max-width: 15rem;
    max-height: 12.5rem;
    padding: 0.025rem;
    border-radius: 0.25rem;
    cursor: url(../cursor/link.cur), default !important;
    object-fit: cover;
  }
}

// 遮盖层
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--main-2-ha2);
  z-index: 99;
}

/* 点赞 */
.like-flag {
  color: var(--pink-color);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 0.1rem;
  height: 0.1rem;
}

::-webkit-scrollbar-track {
  background-color: var(--main-2-h1);
}

::-webkit-scrollbar-thumb {
  background-color: var(--main-1);
  border-radius: 0.03rem;
}

/* 音乐播放器显示隐藏 */
.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
  left: -1.25rem !important;
}

.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
  left: 0 !important;
}